import msgpack from 'msgpack-lite'
// 把msgpack的东西解包成JSON，要注意int64
const msg2Json = function (arrayBuffer, callback) {
  const u8Array = new Uint8Array(arrayBuffer)
  const options = { codec: msgpack.createCodec({ int64: true }) }
  const data = msgpack.decode(u8Array, options)
  callback(data)
}
export default msg2Json
